﻿using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace bleCore
{
    public static class Logger
    {
        static Serilog.Core.Logger deviceLogger;
        static Serilog.Core.Logger msgLogger;
        static Serilog.Core.Logger sysLogger;

        static Logger()
        {
            deviceLogger = new LoggerConfiguration()
                .WriteTo.File("log/device.log", rollingInterval: RollingInterval.Day)
                .CreateLogger();
            msgLogger = new LoggerConfiguration()
                .WriteTo.File("log/msg.log", rollingInterval: RollingInterval.Day)
                .CreateLogger();
            sysLogger = new LoggerConfiguration()
                .WriteTo.File("log/sys.log", rollingInterval: RollingInterval.Day)
                .CreateLogger();
        }
        public static void LogDevice(string msg,params object[] arg)
        {
            deviceLogger.Information(String.Format(msg, arg));
        }
        public static void LogMsg(string msg, params object[] arg)
        {
            msgLogger.Information(String.Format(msg, arg));
        }
        public static void LogSys(string msg, params object[] arg)
        {
            sysLogger.Information(String.Format(msg, arg));
        }
    }
}
